
	var user = Math.floor(Math.random()*2+1);
			var name="";
			var open1 = true;
			var gos1 = true;
			var gos2 = true;
			var gos3 = true;
			var gos4 = true;
			var gos5 = true;
			var gos6 = true;
			var gos7 = true;
			var gos8 = true;
			var gos9 = true;
			if(user==1){
				name="新用户";
			}
			else if(user==2){
				name="老用户";
			}
			window.alert("我是"+name);
			var alert = document.getElementsByClassName("alert")[0];
			var alert1 = alert.getElementsByClassName("alert1")[0];
			var alert2 = alert.getElementsByClassName("alert2")[0];
			var alert3 = alert.getElementsByClassName("alert3")[0];
			var alert4 = alert.getElementsByClassName("alert4")[0];
			function newbtn1(){
				if(open1==true){
					if(name=="新用户"){
						alert.style.display="block";
						alert1.style.display="block";
						open1=false;
					}
					else if(name=="老用户"){
						alert.style.display="block";
						alert2.style.display="block";
					}
				}
				else if(open1==false){
					alert.style.display="block";
					alert3.style.display="block";
				}
			}
			function newbtn2(){
				if(name=="新用户"){
					alert.style.display="block";
					alert1.style.display="block";
				}
				else if(name=="老用户"){
					alert.style.display="block";
					alert2.style.display="block";
				}
				
			}
			function newbtn3(){
				if(name=="新用户"){
					var chous =document.getElementsByClassName("index_chou")[0];
					chous.style.display="block";
					open3=false;
				}
				else if(name=="老用户"){
					alert.style.display="block";
					alert2.style.display="block";
				}
			}
			function openbtn1(){
					alert.style.display="none";
					alert1.style.display="none";
			}
			function openbtn2(){
					alert.style.display="none";
					alert2.style.display="none";
			}
			function openbtn3(){
					alert.style.display="none";
					alert3.style.display="none";
			}
			function openbtn4(){
					alert.style.display="none";
					alert4.style.display="none";
			}
			function showopen(){
				var chous =document.getElementsByClassName("index_chou")[0];
				chous.style.display="none";
			}
			//判断是否抽奖过
var show =true;
//判断是否可以弹出领取
var shows =true;
function draw(){
	//定时开关
	var opener=true;
	var chous =document.getElementsByClassName("index_chou")[0];
	var btns =document.getElementsByClassName("chou_botton")[0];
	var arr = ["img/index/img_one.png","img/index/img_two.png","img/index/img_three.png","img/index/img_four.png"];
	if(show==true){
		//开关只能启动一次
		if(opener==true){
			opener=false;
		var nums = Math.floor(Math.random()*360);
		console.log(nums)
		var btns = document.getElementsByClassName("index_chou2")[0];
		var chou2 = document.getElementsByClassName("chou_juan")[0];
		var num = 0;
		var a =setInterval(function(){
			//先转几圈
			if(num<2161){
				btns.style.transform="rotate("+num+"deg)";
				num=num+10;
			}
			else{
				//清除定时器，
				clearInterval(a);
				var numer = num+nums;
				//随机转多几下
				var b =setInterval(function(){
					if(num<numer){
						btns.style.transform="rotate("+(num)+"deg)";
						num=num+10;
					}
					else{
						clearInterval(b);
						chou2.style.zIndex="300";
						if(nums<=90&&nums>=31){
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[0]+"' />";
						}
						else if(nums<=150&&nums>=91){
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[1]+"' />";
						}
						else if(nums<=210&&nums>=151){
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[0]+"' />";
						}
						else if(nums<=280&&nums>=211){
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[2]+"' />";
						}
						else if(nums<=320&&nums>=281){
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[0]+"' />";
						}
						else{
							chou2.classList.add("fudong");
							chou2.innerHTML="<img src='"+arr[3]+"' />";
						}
						chou2.addEventListener("click",function(){
							chous.style.zIndex="100";
							chous.style.display="none";
							chou2.style.display="none";
							show=false;
							shows=false;
							a=3;
							});
					}
				},100)
			}
			show=false;
		},10);
		}
	}
	else if(show==false){
		if(shows==false){
			alert.style.display="block";
			alert4.style.display="block";
		}
	}
}



